package com.mvc4g.example.shareModel.client.util;

import com.google.gwt.event.shared.GwtEvent;

@SuppressWarnings("unchecked")
public class ModelLoadEvent<T> extends GwtEvent<ModelLoadHandler> {
	
	T model = null;

	public static final Type<ModelLoadHandler> TYPE = new Type<ModelLoadHandler>();
	
	public ModelLoadEvent(T m){
		model = m;
	}

	@Override
	protected void dispatch(ModelLoadHandler handler) {
		handler.finishedLoad(this);
	}

	@Override
	public Type<ModelLoadHandler> getAssociatedType() {
		return TYPE;
	}
	
	public T getModel(){
		return model;
	}

}
